package com.hmj.hmjaiagent.agent.model;

import lombok.Data;

@Data
public abstract class ReActAgent extends BaseAgent {
    public abstract Boolean think();
    public abstract String act();

    @Override
    public String step(String userPrompt) {
        try {
            if (think())
                return act();
            else
                return "思考结束，无须act";
        } catch (Exception e) {
            return "执行失败："+e.getMessage();
        }
    }
}
